package com.net.oil.main.presenter;
/*
 * Created by lch on 2018/2/20 0020.
 */

import com.net.oil.base.BasePresenter;
import com.net.oil.main.bean.AppVersionInfo;
import com.net.oil.main.bean.InitCoupon;
import com.net.oil.main.bean.NewAccountCoupon;
import com.net.oil.main.contract.MainContract;
import com.net.oil.main.model.MainModel;

import java.util.List;

public class MainPresenter extends BasePresenter<MainContract.View> implements MainContract.Presenter {

    private MainContract.Model model;
    private MainContract.View view;

    public MainPresenter(MainContract.View view) {
        this.view = view;
        model = new MainModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void postJPushId(String deviceId, int deviceType) {
        model.postJPushId(deviceId, deviceType);
    }

    @Override
    public void postJPushIdSuccess() {
        view.postJPushIdSuccess();
    }

    @Override
    public void postJPushIdFailed() {
        view.postJPushIdFailed();
    }

    @Override
    public void searchNewAccountCoupon() {
        model.searchNewAccountCoupon();
    }

    @Override
    public void searchNewAccountCouponSuccess(List<NewAccountCoupon> newAccountCoupons) {
        view.searchNewAccountCouponSuccess(newAccountCoupons);
    }

    @Override
    public void searchNewAccountCouponFailed() {
        view.searchNewAccountCouponFailed();
    }

    @Override
    public void initCoupon() {
        model.initCoupon();
    }

    @Override
    public void initCouponSuccess(InitCoupon initCoupon) {
        view.initCouponSuccess(initCoupon);
    }

    @Override
    public void initCouponFailed() {
        view.initCouponFailed();
    }

    @Override
    public void getVersion() {
        model.getVersion();
    }

    @Override
    public void getVersionSuccess(AppVersionInfo appVersionInfo) {
        view.getVersionSuccess(appVersionInfo);
    }

    @Override
    public void getVersionFailed() {
        view.getVersionFailed();
    }
}
